package com.joint.web.action.app;

import com.joint.base.service.UsersService;
import com.joint.web.action.BaseAction;
import net.sf.json.JSONObject;
import org.apache.struts2.convention.annotation.ParentPackage;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 后台Action类 - 注册
 * ============================================================================
 * 版权所有 2013 min_xu。
 * ----------------------------------------------------------------------------
 * 
 * @author min_xu
 * 
 * @version 0.1 2013-7-15
 */

@ParentPackage("app")
public class LoginAction extends BaseAction {
	private static final long serialVersionUID = -5383463207248344967L;

	@Resource
	private UsersService usersService;

	/**
	 * App登录，具体通过Shiro Filter实现
	 */
	public String execute() {
		users = getRequestUsers();
        if(users==null){
            return ajaxHtmlAppResult(0, "登录账户异常，找不到用户",null);
        }
		Map<String, Object> mpMap = usersService.getLoginItemMap(users);
		return ajaxHtmlAppResult(1, "", JSONObject.fromObject(mpMap));
	}

}